export default {
  data() {
    return {

    };
  },
  methods: {
    getYesterday() {
      let today = new Date();
      today.setTime(today.getTime() - 24 * 60 * 60 * 1000);
      let year =  today.getFullYear();
      let month =  (today.getMonth() + 1) < 10? `0${(today.getMonth() + 1)}`:today.getMonth() + 1;
      let day =  (today.getDate()) < 10 ? `0${today.getDate()}`: today.getDate();
      let yesterday = year + "-" + month + "-" + day;
      return yesterday
    },
    getSevenDay() {
      let today = new Date();
      today.setTime(today.getTime() - 24 * 60 * 60 * 1000 * 7);
      let year =  today.getFullYear();
      let month =  (today.getMonth() + 1) < 10? `0${(today.getMonth() + 1)}`:today.getMonth() + 1;
      let day =  (today.getDate()) < 10 ? `0${today.getDate()}`: today.getDate();
      let sevenDay = year + "-" + month + "-" + day;
      return sevenDay
    },
    getMonthFirstDay() {
      let today = new Date();
      today.setDate(1);
      let year =  today.getFullYear();
      let month =  (today.getMonth() + 1) < 10? `0${(today.getMonth() + 1)}`:today.getMonth() + 1;
      let day =  (today.getDate()) < 10 ? `0${today.getDate()}`: today.getDate();
      let dateStart = year + "-" + month + "-" + day;
      return dateStart
    },
  },
};
